* Consider an M/G/1/2/2 queuing system.
* This problem is explained in "Markov regenerative stochastic
* Petri nets" by H. Choi, V.G. Kulkarni and K.S. Trivedi, Perf. 
* Eval. vol. 20, pp. 335--357, 1994.

* Assume that, the service times are hypo-exponentially 
* distributed with parameters lambda1=2 and lambda=4.
* Find the system state probabilities, average customer in 
* the system.
 
format 8

bind 
lambda 0.5
end

mrgp m_g_1_2_2
2001 @ 1010 exp(2*lambda)
1010 - 0110 exp(lambda)
1010 @ 2001 hypoexp(4,2)
0110 @ 1010 hypoexp(4,2)
* Reward function for the average customer in the system
reward
2001 0
1010 1
0110 2
end

echo Steady State Probabilities:
expr prob(m_g_1_2_2, 2001), prob(m_g_1_2_2,1010)
expr prob(m_g_1_2_2,0110)

echo Expected Customers in the System:
expr exrss(m_g_1_2_2)
end


